package cn.xinfei.xdecision.common.dao.datax.datamanage.v2;

import java.util.Collection;
import java.util.List;

import cn.xinfei.xdecision.common.model.datax.datamanage.request.VarSnapshotBatchDeleteParam;
import org.apache.ibatis.annotations.Param;

import cn.xinfei.xdecision.common.model.datax.datamanage.v2.VariableSnapshot;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface VariableSnapshotMapper extends BaseMapper<VariableSnapshot> {

    List<VariableSnapshot> findByVarCode(@Param("varCode") String varCode, @Param("organId") Long organId);

    List<VariableSnapshot> findByVarCodes(@Param("varCodes") Collection<String> varCodes, @Param("organId") Long organId);

    List<VariableSnapshot> findAllVarCodes(@Param("organId") Long organId);

    Long findLatestVersion(@Param("varCode") String varCode, @Param("organId") Long organId);

    int update(VariableSnapshot variableSnapshot);

    VariableSnapshot findByVarCodeAndVersion(@Param("varCode") String varCode, @Param("organId") Long organId, @Param("version") Long version);


    void logicalDelete(@Param("varCode") String varCode, @Param("organId") Long organId);

    void batchLogicalDelete(VarSnapshotBatchDeleteParam deleteParam);

}
